using System;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.SupplyChain.Warehouse;

/// <summary>
/// 库位实体类
/// 用于管理仓库内的具体存储位置
/// </summary>
[Display(Name = "库位", Description = "仓库库位管理", GroupName = "供应链")]
public class SysWarehouseLocation : BasePoco
{
    /// <summary>
    /// 库位名称
    /// </summary>
    [Display(Name = "库位名称", Description = "库位名称", GroupName = "基本信息")]
    [StringLength(128)]
    public string Name { get; set; }
    
    /// <summary>
    /// 库位编码
    /// </summary>
    [Display(Name = "库位编码", Description = "库位编码", GroupName = "基本信息")]
    [StringLength(128)]
    public string Code { get; set; }
    
    /// <summary>
    /// ERP系统中的编号
    /// </summary>
    [Display(Name = "ERP编号", Description = "ERP系统中的编号", GroupName = "基本信息")]
    [StringLength(128)]
    public string ErpId { get; set; }
    
    /// <summary>
    /// 关联的库区
    /// </summary>
    [Display(Name = "所属库区", Description = "关联的库区", GroupName = "关联信息")]
    public SysWarehouseArea Area { get; set; }
    
    /// <summary>
    /// 关联的库区ID
    /// </summary>
    [Display(Name = "库区ID", Description = "关联的库区ID", GroupName = "关联信息")]
    public Guid? AreaId { get; set; }
    
    /// <summary>
    /// 关联的仓库
    /// </summary>
    [Display(Name = "所属仓库", Description = "关联的仓库", GroupName = "关联信息")]
    public SysWarehouse Warehouse { get; set; }
    
    /// <summary>
    /// 关联的仓库ID
    /// </summary>
    [Display(Name = "仓库ID", Description = "关联的仓库ID", GroupName = "关联信息")]
    public Guid? WarehouseId { get; set; }
    
    /// <summary>
    /// 库位描述信息
    /// </summary>
    [Display(Name = "描述", Description = "库位描述信息", GroupName = "基本信息")]
    [StringLength(512)]
    public string Description { get; set; }
    
    /// <summary>
    /// 库位状态
    /// </summary>
    [Display(Name = "状态", Description = "库位状态", GroupName = "基本信息")]
    public CommonState CommonState { get; set; }
}

public class SysWarehouseLocationView : SysWarehouseLocation
{
    [Display(Name = "库区名称", Description = "库区名称", GroupName = "关联信息")]
    public string AreaCode { get; set; }
    
    [Display(Name = "仓库名称", Description = "仓库名称", GroupName = "关联信息")]
    public string WarehouseCode { get; set; }
}